using System.ComponentModel.DataAnnotations;


namespace UwinEducation.Application.Dtos
{
    /// <summary>
    /// 角色DTO
    /// </summary>
    public class RoleDto
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 角色描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 角色列表Code
        /// </summary>
        public List<string> PermissionCodes { get; set; }

    }

    /// <summary>
    /// 创建角色DTO
    /// </summary>
    public class CreateRoleDto
    {
        /// <summary>
        /// 角色名称
        /// </summary>
        [Required(ErrorMessage = "角色名称不能为空")]
        public string Name { get; set; }

        /// <summary>
        /// 角色描述
        /// </summary>
        public string? Description { get; set; }
    }

    /// <summary>
    /// 更新角色DTO
    /// </summary>
    public class UpdateRoleDto : CreateRoleDto
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        [Required(ErrorMessage = "角色ID不能为空")]
        public Guid Id { get; set; }
    }

    /// <summary>
    /// 分配菜单DTO
    /// </summary>
    public class AssignMenusDto
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        public Guid RoleId { get; set; }

        /// <summary>
        /// 菜单Code列表
        /// </summary>
        [Required(ErrorMessage = "菜单Code列表不能为空")]
        public List<string> PermissionCodes { get; set; }
    }
}